# coding=UTF-8
'''
封装驱动.
'''

from appium import webdriver

S = "zhifubao"


class AppDriver:

    @staticmethod
    def driver():
        caps = {
            # "deviceName": "7XB4C18B23007643",# 我的荣耀8x
            "deviceName": ("%s" % S),  # 随便写就可以这个参数
            "platformName": "Android",
            "appPackage": "com.eg.android.AlipayGphone",
            "appActivity": "com.eg.android.AlipayGphone.AlipayLogin",
            # 设置超时时间
            "newCommandTimeout": 6000,
            # 不重置被测应用
            "noReset": True
        }

        driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', caps)
        driver.implicitly_wait(10)
        # globals()['loginname'] = gonggongfangfa.name_phone(cls)[0]
        # globals()["riqi"] = time.strftime('%m%d%H%M', time.localtime(time.time()))
        return driver

#
# def Dr(self):
#     self.Dri()
#
#
# if __name__ == '__main__':
#     D = AppDriver()
#     Dr(D)